<!DOCTYPE html>
<html lang="ru">
<head>
	<meta charset="utf-8">
	<title>Goldentime</title>
	<script type="text/javascript" src="template/js/jquery.js"></script>
	<script type="text/javascript" src="template/js/core.js"></script>
	<script type="text/javascript" src="template/js/location.js"></script>
	
	<link rel="stylesheet" href="template/style.css" type="text/css" media="screen" />
</head>
<body>
<header>
	<?php include 'library/core.php';
		$admin_obj = new admin();
	?>
	<div class="menu_bg">
		<div class="logo">
			<a href="index.php" title="Goldentime"><img src="images/header/logo.png" alt="Goldentime"/></a>
		</div>
		<?php if(isset($_SESSION['user']['id'])): ?>
		<nav>
			<ul>
				<?php
				$menu = $admin_obj->in_menu();
				if ($menu!=false){
					for ($i=0; $i<count($menu);$i++){
						echo '<li><a href="page.php?idpage='.$menu[$i]['id'].'"title="'.$menu[$i]['title'].'">'.$menu[$i]['title'].'</a></li>';
					}
				}
				?>
				<?php if(!empty($_SESSION['user']['id'])): ?><li><a href="admin/profile.php?action=cabinet">Перейти в кабинет</a></li><?php endif; ?>
			</ul>
		</nav>
		<?php endif; ?>
		<?php if (!isset($_SESSION['user']['id'])):?>
			<div class="auth">
				<a href="register.php" class="user-register"></a>
				<a href="" class="user-login"></a>
			</div>
		<?php endif;?>
	</div>
</header>	
	
<section>
	<?php if (!isset($_SESSION['user']['id'])):?>
		<div class="lost_pass">				
			<p><label for="restore_pass">email</label><input type="text" name="restore_pass" id="restore_pass" maxlength="255"/></p>	
			<p><input type="button" value="Возобновить" id="user-lost"/></p>			
		</div>	
	<?php else:?> <script type="text/javascript"> window.location.href = 'admin/profile.php?action=cabinet'</script>
	<?php endif; ?>
</section>

<footer>
	<div class="in">
		<span>&copy;2010-2012. <a href="index.php" title="ЗОЛОТОЕ ВРЕМЯ">ЗОЛОТОЕ ВРЕМЯ. </a> Все права защищены.</span>
		<div class="counters">
			<a href="#">
				<img src="images/footer/counter.jpg" alt=""/>
			</a>
		</div>
		<?php if(isset($_SESSION['user']['id'])): ?>
		<nav>
			<ul>
				<?php $mas = $admin_obj->in_menu();
					if ($mas!=false){
						for ($i=0; $i<count($mas);$i++){
							echo '<li><a href="page.php?idpage='.$mas[$i]['id'].'"title="'.$mas[$i]['title'].'">'.$mas[$i]['title'].'</a></li>';
						}
					}
				?>
			</ul>
		</nav>
		<?php endif; ?>
	</div>
</footer>
</body>
</html>